package com.keepercloud.qqchat.controller;

import com.keepercloud.qqchat.entity.User;
import com.keepercloud.qqchat.framework.common.exception.SimpleException;
import com.keepercloud.qqchat.framework.common.listener.SessionListener;
import com.keepercloud.qqchat.framework.common.result.Result;
import com.keepercloud.qqchat.service.UserListService;
import com.keepercloud.qqchat.service.UserService;
import com.keepercloud.qqchat.util.Encrypt;
import com.keepercloud.qqchat.util.UserUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import java.util.List;
import java.util.Map;

/**
 * @author liyk
 * @date 2019/2/12
 */
@RestController
@RequestMapping("userList")
public class UserListController {

    final private
    UserListService userListService;

    @Autowired
    public UserListController(UserListService userListService) {
        this.userListService = userListService;
    }

    @GetMapping
    public Result getUserList() {
        String userName = UserUtil.getUserName();
        return new Result(userListService.getUserList(userName));
    }


}
